package com.duowei.diandan.db.dao;

import android.arch.persistence.room.Dao;
import android.arch.persistence.room.Insert;
import android.arch.persistence.room.Query;

import com.duowei.diandan.db.entry.Dmjyxmsslb;

import java.util.List;

@Dao
public interface DmjyxmsslbDao {

    @Query("SELECT * FROM dmjyxmsslb WHERE sfxs = :sfxs ORDER BY xl")
    List<Dmjyxmsslb> findBySfxs(String sfxs);

    @Query("SELECT * FROM dmjyxmsslb ORDER BY xl")
    List<Dmjyxmsslb> findAll();

    @Query("SELECT * FROM dmjyxmsslb WHERE lbmc = :lbmc LIMIT 1")
    Dmjyxmsslb findByLbmc(String lbmc);

    @Insert
    void insert(List<Dmjyxmsslb> list);

    @Query("DELETE FROM dmjyxmsslb")
    void deleteAll();
}
